#
# curvefs client options
#
# client配置文件位置
client.config_path={{ snap_client_config_path }}
# mds root 用户名
mds.rootUser={{ curve_root_username }}
# mds root 密码
mds.rootPassword={{ curve_root_password }}
# 调用client方法的重试总时间
client.methodRetryTimeSec={{ snap_client_method_retry_time_sec }}
# 调用client方法重试间隔时间
client.methodRetryIntervalMs={{ snap_client_method_retry_interval_ms }}

# 日志文件位置
log.dir={{ snap_log_dir }}

#
# S3 config path
#
s3.config_path={{ snap_s3_config_path }}
#
#server options
#
# for snapshot
server.address={{ ansible_ssh_host }}:{{ snapshot_port }}
server.subnet={{ snapshot_subnet }}
server.port={{ snapshot_port }}
# 调用client异步方法重试总时间
server.clientAsyncMethodRetryTimeSec={{ snap_client_async_method_retry_time_sec }}
# 调用client异步方法重试时间间隔
server.clientAsyncMethodRetryIntervalMs={{ snap_client_async_method_retry_interval_ms }}
# 快照工作线程数
server.snapshotPoolThreadNum={{ snap_snapshot_pool_thread_num }}
# 快照后台线程扫描等待队列和工作队列的扫描周期(单位：ms)
server.snapshotTaskManagerScanIntervalMs={{ snap_snapshot_task_manager_scan_interval_ms }}
# 转储chunk分片大小
server.chunkSplitSize={{ snap_chunk_split_size }}
# CheckSnapShotStatus调用间隔
server.checkSnapshotStatusIntervalMs={{ snap_check_snapshot_status_interval_ms }}
# 最大快照数
server.maxSnapshotLimit={{ snap_max_snapshot_limit }}
# 同时执行转储的线程数
server.snapshotCoreThreadNum={{ snap_snapshot_core_thread_num }}
# mds session 时间
server.mdsSessionTimeUs={{ file_expired_time_us }}
# 每个线程同时进行ReadChunkSnapshot和转储的快照分片数量
server.readChunkSnapshotConcurrency={{ snap_read_chunk_snapshot_concurrency }}

# for clone
# 用于Lazy克隆元数据部分的线程池线程数
server.stage1PoolThreadNum={{ snap_stage1_pool_thread_num }}
# 用于Lazy克隆数据部分的线程池线程数
server.stage2PoolThreadNum={{ snap_stage2_pool_thread_num }}
# 用于非Lazy克隆和删除克隆等其他管控面的请求的线程池线程数
server.commonPoolThreadNum={{ snap_common_pool_thread_num }}
# CloneTaskManager 后台线程扫描间隔
server.cloneTaskManagerScanIntervalMs={{ snap_clone_task_manager_scan_interval_ms }}
# clone chunk分片大小
server.cloneChunkSplitSize={{ snap_clone_chunk_split_size }}
# 克隆临时目录
server.cloneTempDir={{ snap_clone_temp_dir }}
# CreateCloneChunk同时进行的异步请求数量
server.createCloneChunkConcurrency={{ snap_create_clone_chunk_concurrency }}
# RecoverChunk同时进行的异步请求数量
server.recoverChunkConcurrency={{ snap_recover_chunk_concurrency }}
# CloneServiceManager引用计数后台扫描每条记录间隔
server.backEndReferenceRecordScanIntervalMs={{ snap_clone_backend_ref_record_scan_interval_ms }}
# CloneServiceManager引用计数后台扫描每轮记录间隔
server.backEndReferenceFuncScanIntervalMs={{ snap_clone_backend_ref_func_scan_interval_ms }}

#
# etcd相关配置
#
# etcd地址
{% set etcd_address=[] -%}
{% for host in groups.etcd -%}
  {% set etcd_ip = hostvars[host].ansible_ssh_host -%}
  {% set etcd_port = hostvars[host].etcd_listen_client_port -%}
  {% set _ = etcd_address.append("%s:%s" % (etcd_ip, etcd_port)) -%}
{% endfor -%}

etcd.endpoint={{ etcd_address | join(',') }}
# client建立连接的超时时间
etcd.dailtimeoutMs={{ snap_etcd_dailtimeout_ms }}
# client进行put/get/txn等操作的超时时间
etcd.operation.timeoutMs={{ snap_etcd_operation_timeout_ms }}
# client操作失败可以重试的次数
etcd.retry.times={{ snap_etcd_retry_times }}
# wait dlock timeout
etcd.dlock.timeoutMs={{ snap_etcd_dlock_timeout_ms }}
# dlock lease timeout
etcd.dlock.ttlSec={{ snap_etcd_dlock_ttl_sec }}

#
# leader选举相关参数
#
# leader lock名称
leader.campagin.prefix={{ snap_leader_campagin_prefix }}
# leader竞选时会创建session, 单位是秒(go端代码的接口这个值的单位就是s)
# 该值和etcd集群election timeout相关.
# etcd的server端限制了该值最小为1.5 * election timeout
# 建议设置etcd集群election timeout为1s
leader.session.intersec={{ snap_leader_session_inter_sec }}
# leader竞选的超时时间，如果为0竞选不成功会一直block, 如果大于0，在electionTimeoutMs时间
# 内未当选leader会返回错误
leader.election.timeoutms={{ snap_leader_election_timeout_ms }}

#
# dummyserver相关配置
#
server.dummy.listen.port={{ snapshot_dummy_port }}
